package com.kittlen.managementSystem.utils;

import java.util.*;

/**
 * @author kittlen
 * @version 1.0
 * @date 2021/1/27 20:36
 */
public class ObjectUtil {
    public static boolean isNoEmpty(Object o){
        if(o==null){
            return false;
        }
        if(o instanceof String) {
            if (String.valueOf(o).trim().isEmpty()) {
                return false;
            }
        }
        if(o instanceof Collection){
            if(((Collection)o).size()==0){
                return false;
            }
        }
        if(o instanceof Map){
            if(((Map)o).size()==0){
                return false;
            }
        }

        return true;
    }

    public static boolean isEmpty(Object o){
        return !isNoEmpty(o);
    }

}
